/*************************************************************
 *Name:           Christopher Alexander
 *Email address:  alexanc2@onid.oregonstate.edu
 *Class name:     CS362
 *Assignment:     Assignment #3
 *Description:    This file (unittest3.c) contains unit tests
                  for getCost() in dominion.c
 *************************************************************/

#include "dominion.h"
#include "dominion_helpers.h"
#include <string.h>
#include <stdio.h>
#include <assert.h>
#include "rngs.h"

#define NUM_UNIQUE_CARDS 27 //At least by my count this is right.


int main() {
   int i;
   int randNumber;

   //-1 is a special case where an invalid card is passed to getCost()
   int cardNumber[NUM_UNIQUE_CARDS + 1] = {curse, estate, duchy, province, copper,
                        silver, gold, adventurer, council_room,
                        feast, gardens, mine, remodel, smithy,
                        village, baron, great_hall, minion, steward,
                        tribute, ambassador, cutpurse, embargo,
                        outpost, salvager, sea_hag, treasure_map, -1};
   int cardCost[NUM_UNIQUE_CARDS + 1] = {0, 2, 5, 8, 0,
                                    3, 6, 6, 5,
                                    4, 4, 5, 4, 4,
                                    3, 4, 3, 5, 3,
                                    5, 3, 4, 2,
                                    5, 4, 4, 4, -1};

   printf("\nTesting getCost():\n");

   for (i = 0; i < 1000; i++){
      randNumber = (int) (Random() * (NUM_UNIQUE_CARDS + 1));

      if (cardCost[randNumber] != getCost(cardNumber[randNumber])){
         printf("\tBUG FOUND RUNNING getCost()\n");
      }
   }

   return 0;
}
